/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package business;

import data.Userinfotable;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author stana
 */
@Stateless
public class UserinfotableFacade extends AbstractFacade<Userinfotable>
{

    @PersistenceContext(unitName = "SmsWeatherPU")
    private EntityManager em;

    protected EntityManager getEntityManager()
    {
        return em;
    }

    public UserinfotableFacade()
    {
        super(Userinfotable.class);
    }

    public Userinfotable findByUserId(String userID)
    {
        Userinfotable ui = null;
        try
        {
            ui = (Userinfotable) em.createNamedQuery("Userinfotable.findByUserid").
                    setParameter("userid", userID).getSingleResult();
        } catch (Exception e)
        {
        }
        return ui;

    }
}
